/*
 * @Date: 2022-09-26 15:46:00
 * @LastEditors: Chuying
 * @LastEditTime: 2022-11-01 13:25:17
 * @Description:
 */
import React from 'react';
import ReactDOM from 'react-dom/client';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter, useRoutes } from 'react-router-dom';
import routes from './routes';
import Layout from './layout';
import 'lib-flexible';
import './index.css';

const GetRoutes = () => useRoutes(routes);

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
    <BrowserRouter>
        {/* <Layout> */}
        <GetRoutes></GetRoutes>
        {/* <Routes>
                {routes.map((route) => (
                    <Route
                        key={route.key}
                        path={route.path}
                        element={route.element}
                    ></Route>
                ))}
            </Routes> */}
        {/* </Layout> */}
    </BrowserRouter>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
